import java.util.LinkedList;
import java.util.Queue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wangxin
 * Date: 2025-01-19
 * Time: 21:56
 */
public class test {
    public static void main(String[] args) {
        MyCircularQueue q = new MyCircularQueue(5);
       q.enQueue(1); // 从队尾入队列
       q.enQueue(2); // 从队尾入队列
       q.enQueue(3); // 从队尾入队列
       q.enQueue(4); // 从队尾入队列
       q.enQueue(5); // 从队尾入队列
        System.out.println(q.size());
        System.out.println(q.Front()); // 获取队头元素
        q.deQueue();
        System.out.println(q.deQueue()); // 从队头出队列，并将删除的元素返回
        if(q.isEmpty()){
            System.out.println("队列空");
        }else{
            System.out.println(q.size());
        }
    }
    public static void main1(String[] args) {
        Queue<Integer> q = new LinkedList<>();
        q.offer(1);
        q.offer(2);
        q.offer(3);
        q.offer(4);
        q.offer(5); // 从队尾入队列
        System.out.println(q.size());
        System.out.println(q.peek()); // 获取队头元素
        q.poll();
        System.out.println(q.poll()); // 从队头出队列，并将删除的元素返回
        if(q.isEmpty()){
            System.out.println("队列空");
        }else{
            System.out.println(q.size());
        }
    }
}
